package org.hzz.promotions.domain.repository;

import io.gitee.pkmer.convention.page.PageResponse;
import io.gitee.pkmer.convention.page.query.PageQuery;
import org.hzz.promotions.domain.entity.UserCouponEntity;
import org.hzz.promotions.domain.valueobject.CouponReceive;

import java.util.List;

/**
 * @author <a href="mailto:1193094618@qq.com">pkmer</a>
 * <br>
 * <a href = "https://gitee.com/developeros/videos-online">Code Repository</a>
 * At 2024/9/2
 */
public interface UserCouponRepository {
    /**
     * 根据用户id获取用户优惠券
     * @param userId 用户id
     * @return
     */
    List<UserCouponEntity> selectUserCouponByUserId(Long userId);

    /**
     * 计算用户领取指定优惠券的数量
     * @param userId 用户id
     * @param couponIds 优惠券id
     * @return 领取数量
     */
    List<CouponReceive> countReceivedCouponNum(Long userId, List<Long> couponIds);

    /**
     * 插入数据
     * @param entity 数据
     */
    void insertUserCoupon(UserCouponEntity entity);

    /**
     * 分页查询优惠券
     * @param pageQuery 分页查询参数
     * @return 用户优惠券实体
     */
    PageResponse<UserCouponEntity> pageQueryUserCoupon(PageQuery pageQuery);
}
